package com.company.card_service.api;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.company.card_service.constant.ApiTextHelperConstant;
import com.company.card_service.constant.DeveloperConstant;
import com.company.card_service.model.CompanyModel;
import com.company.card_service.serviceImpl.CompanyModelServiceImpl;
import com.company.card_service.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("api/company/model")
@Api(tags = "小程序端导航栏管理")
public class ApiModelController {

    @Autowired
    private CompanyModelServiceImpl companyModelService;

    @ApiOperation(value = "公司id获取导航栏模块", notes = ApiTextHelperConstant.DEVELOPER + DeveloperConstant.LIJUNLIN)
    @GetMapping("/getCompanyModel/{companyId}")
    public Result getCompanyModel(@PathVariable Integer companyId){
        LambdaQueryWrapper<CompanyModel> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(CompanyModel::getCompanyId,companyId);
        List<CompanyModel> list = companyModelService.list(lambdaQueryWrapper);
        return Result.success(list);
    }
}
